CREATE TABLE Images
(
	ImageID INT UNSIGNED NOT NULL AUTO_INCREMENT,
	ImageName CHAR(64),
	ImageSize VARCHAR(32),
	ImageTime DATETIME,
	ImageObjectsNum INT,
	ImageExposure FLOAT(8) UNSIGNED,
	ImageFstop FLOAT(2, 1) UNSIGNED,
	ImageGPS VARCHAR(32),
	ImageLocation VARCHAR(128),
	ImageCategory VARCHAR(64),
	ImageSky TINYINT,
	ImageWater TINYINT,
	ImageFoliage TINYINT,
	ImageGround TINYINT,
	ImageRock TINYINT,
	ImageAnimal TINYINT,
	ImageManmade TINYINT,
	ImagePeople TINYINT,
	ImageDescriptors TEXT,

	PRIMARY KEY(ImageID)
);

CREATE TABLE Objects
(
	ObjectID INT UNSIGNED NOT NULL AUTO_INCREMENT,
	ObjectName VARCHAR(64),
	ImageID INT UNSIGNED NOT NULL REFERENCES Images(ImageID),

	PRIMARY KEY(ObjectID)
);

CREATE TABLE ObjectsData
(
	ObjectDataID INT UNSIGNED NOT NULL AUTO_INCREMENT,
	ObjectCategory VARCHAR(16),
	ObjectSpecular TINYINT,
	ObjectLighting TINYINT,
	ObjectOcclusion TINYINT,
	ObjectLife TINYINT,
	ObjectSurface TINYINT,
	ObjectShadow TINYINT,
	ObjectFocus TINYINT,
	ObjectSegmentQuality TINYINT,
	ObjectDescriptor TEXT,
	ObjectBinaryMask VARCHAR(128),
	ObjectXs MEDIUMBLOB,
	ObjectYs BLOB,
	ObjectPixels BLOB,
	ObjectRGB MEDIUMBLOB,
	ObjectID INT UNSIGNED NOT NULL REFERENCES Objects(ObjectID),

	PRIMARY KEY(ObjectDataID)
);